package validate

import (
	"gin/common"
	"gin/model"
	"github.com/Gre-Z/common/jtime"
)

type AddSentenceWrapper struct {
	Data model.Sentence `json:"data" binding:"required"`
}

type UpdateSentenceWrapper struct {
	Data UpdateSentence `json:"data" binding:"required"`
}
type UpdateSentence struct {
	Id        uint64           `json:"id" binding:"required"`
	Content   string           `json:"content" binding:"required"`
	Neutral   float64          `json:"neutral" binding:"max=128"`
	Positive  float64          `json:"positive" binding:"max=128"`
	Sentiment string           `json:"sentiment" binding:"max=128"`
	CustomTag string           `json:"custom_tag" binding:"max=128"`
	Negative  float64          `json:"negative" binding:"max=128"`
	Created   jtime.TstampTime `json:"created"`
	Updated   jtime.TstampTime `json:"updated"`
}

type AddSentence struct {
	Id        uint64           `json:"id"`
	DictId    uint64           `json:"dict_id"`
	Content   string           `json:"content" binding:"required"`
	Neutral   float64          `json:"neutral" binding:"max=128"`
	Positive  float64          `json:"positive" binding:"max=128"`
	Sentiment string           `json:"sentiment" binding:"max=128"`
	Negative  float64          `json:"negative" binding:"max=128"`
	Created   jtime.TstampTime `json:"created"`
	Updated   jtime.TstampTime `json:"updated"`
	CustomTag string           `json:"custom_tag" binding:"max=128"`
}

type SelectSentenceQuery struct {
	Param common.QueryParam `json:"param" binding:"required"`
}

type LexicalAnalysisSentence struct {
	Param               common.QueryParam `json:"param" binding:"required"`
	DictId              uint64            `json:"dict_id" binding:"min=0"`
	ReplaceOldResult    int8              `json:"replace_old_result"`
	IsAsync             string            `json:"is_async" binding:"oneof=yes no"`
	IsSentimentAnalysis string            `json:"sentiment_analysis" binding:"oneof=yes no"`
}

type SentimentAnalysisSentence struct {
	Param   common.QueryParam `json:"param" binding:"required"`
	IsAsync string            `json:"is_async" binding:"oneof=yes no"`
}

type DeleteSentenceParam struct {
	Param common.Filter `json:"param" binding:"required"`
}

type SentenceAddAndLexicalAnalysis struct {
	Content                  string   `json:"content" binding:"required"`
	DictId                   uint64   `json:"dict_id"`
	AnalysisKeyword          bool     `json:"analysis_keyword"`
	AnalysisSentiment        bool     `json:"analysis_sentiment"`
	AnalysisSimilarWordPos   []string `json:"analysis_similar_word_pos"`
	CompareLocalCustomTag    bool     `json:"compare_local_custom_tag"`
	SpecifiedMatchEntityType []string `json:"specified_match_entity_type"`
	MatchNumber              int      `json:"match_number" binding:"min=0,max=100"`
}
